/**
 * Created by yaohuan on 2018/5/3 0003.
 */
define(["vue"],function (vue) {

    var list = new Vue({
		el: document.getElementById('list'),
		data: {
            count:0
		},
        watch: {
            count:function (n) {
                if(n=0){
                    var numbox = $('#numbox');
                    numbox.removeClass('showLeft');
                }else{
                    var numbox = $('#numbox');
                    numbox.addClass('showLeft');
                }
            }
        },
        methods: {
            add:function (e) {
            	//e.preventDefault();
                var numbox = $('#numbox');
                numbox.addClass('showLeft');
                this.count++;
            },
            reduce:function () {
                if(count.innerText <= 1){
                    var numbox = $('#numbox');
                    numbox.removeClass('showLeft');
				}else {
                    this.count--;
				}
			},
            openWindow: function () {
                    app.openPage({
                        src: "classes-info.html"
                    });
            }
		}
	})
})